package chixing.day07.inherited;

import java.util.HashSet;
import java.util.Set;

public class ProductTest {
   public static void main(String[] args) {
//       Product product1 = new Product();
//       product1.setProName("电脑");
//       product1.setProPrice(5000.1f);
//        //输出显示名称
//        //输出显示价格
//        System.out.println(product1.getProName());
//        System.out.println(product1.getProPrice());
//
//        Product product2 = new Product(1,"手机",1000.2f);
//        System.out.println(product2.getProName());
//        System.out.println(product2.getProPrice());
//    }
Product p1 = new Product(1,"电脑",5000.1f);
    Product p2 = new Product(2,"鼠标",20.2f);
    Product p3 = new Product(3,"键盘",50.5f);
    Product p4 = new Product(3,"键盘",50.5f);
    Product p5 = new Product(5,"USB",10.1f);
    //set 容器  元素不能重复
    Set set = new HashSet();
        set.add(p1);
        set.add(p2);
        set.add(p3);//hashCode()
        set.add(p4);
        set.add(p5);
        set.forEach(System.out::println);
}
}
